<?php
require_once 'IConnection.class.php';

abstract class AbstractConnection implements IConnection {
    
    /* Atributo de log para todas as classes filhas. */
    protected $log;

    protected $dbHost;
    protected $dbPort;
    protected $dbName;
    protected $dbUser;
    protected $dbPass;
    protected $conn;

    protected function __construct($hostname, $hostport, $database, $username, $password) {
        $this->log = new Log();
        $this->dbHost = $hostname;
        $this->dbPort = $hostport;
        $this->dbName = $database;
        $this->dbUser = $username;
        $this->dbPass = $password;
    }

    public function __destruct() {
        if (isset($this->conn)) {
            $this->close();
        }
    }

}

?>
